<?php
require(APPPATH.'libraries/REST_Controller.php');

class Branch extends REST_Controller {
	function get_id_get()
	{
		$code = $this->get('code');
		$this->load->model('branch_model');
		if($code == null){
			$this->response('Code is required', 404);
		}
		$branch = $this->branch_model->get_branch_by_code($code);
		if ($branch == null){
			$this->response(NULL, 404);
		}else
		{
			$this->response($branch->branch_id, 200);
		}
	}
}